package com.wbu.estatemanagement.controller;

import com.wbu.estatemanagement.common.MessageConstant;
import com.wbu.estatemanagement.common.Result;
import com.wbu.estatemanagement.common.StatusCode;
import com.wbu.estatemanagement.service.ParkingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("parking")
public class ParkingController {

    @Autowired
    ParkingService parkingService;

    @PostMapping("/count")
    public Result count(){
        Map<String,Integer> count= parkingService.coutParking();
        return new Result(true, StatusCode.OK, MessageConstant.SUCCESS,count);

    }
}
